
.chatsonic-view {
    padding: 5px 10px;
    height: calc(100vh - 60px);
    /* 减去头部和底部的高度 */
     max-width: 100%;
    .el-row {
        height: 100%;
    }

    h1{
      margin: 0 0 0px;
      color: #409eff !important;
      font-size: 24px;
      text-align: left;
    }
}

.text-center {
    text-align: center;
    margin-bottom: 10px;
    padding: 10px 10px 0;
    margin: 0 auto;
    font-size: 1em;
    color: #003366;
}


.chat-container {
  display: flex;
  flex-direction: column;
  height: 95%;
  max-height:calc(100% - 20px); 
  padding: 0.2rem;
  gap: 1rem;
  // max-width: 800px;
  margin: 0 auto;
  margin-top: 10px;
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
  overflow: hidden;
 
}

.chat-topic {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem;
  background-color: #f5f7fa;
  border-radius: 4px;
}

.message-container {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.welcome-message {
  text-align: center;
  color: #606266;
  padding: 2rem;
}

.welcome-message .el-icon {
  font-size: 48px;
  color: #409eff;
  margin-bottom: 1rem;
}

.message {
  display: flex;
  gap: 1rem;
  max-width: 93%;
}

.user-message {
  margin-left: auto;
  flex-direction: row-reverse;
}

.ai-message {
  margin-right: auto;
}

.message-avatar {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background-color: #f5f7fa;
  display: flex;
  align-items: center;
  justify-content: center;
}

.user-message .message-avatar {
  background-color: #409eff;
  color: white;
}

.message-content {
  background-color: #f5f7fa;
  padding: 0.8rem;
  border-radius: 8px;
  position: relative;

}

.user-message .message-content {
  background-color: #409eff;
  color: white;
  padding: 5px 10px;
}

.message-text {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 12px;
}

.message-time {
  font-size: 0.75rem;
  color: #909399;
  margin-top: 0.25rem;
}

.user-message .message-time {
  color: #e6e6e6;
}

.input-container {
  display: flex;
  gap: 1rem;
  padding: 1rem;
  background-color: #f5f7fa;
  border-radius: 8px;
}

.input-container .el-input {
  flex: 1;
}

/* 滚动条样式 */
.message-container::-webkit-scrollbar {
  width: 6px;
}

.message-container::-webkit-scrollbar-thumb {
  background-color: #909399;
  border-radius: 3px;
}

.message-container::-webkit-scrollbar-track {
  background-color: #f5f7fa;
}

/* 移动端和竖屏适配 */
@media (max-width: 768px) {
  .chat-container {
    height: calc(100vh - 120px);
    margin: 10px;
    padding: 0.5rem;
  }

  .message {
    max-width: 90%;
  }

  .input-container {
    padding: 0.5rem;
  }
}